﻿#pragma once

#include "../Utils/HCNMath.h"

class C_Entity;

class C_EntityList {
private:
	[[maybe_unused]] uint8_t pad_0x0000[0x70]{};  // 0x0000
public:
	uintptr_t firstEntity{};  // 0x0050
	uintptr_t lastEntity{};   // 0x0058
	uintptr_t endAddr{};      // 0x0060

	inline constexpr size_t getListSize() const {
		return (lastEntity - firstEntity) / sizeof(uintptr_t);
	}

	inline constexpr C_Entity* get(size_t idx) const {
		if (idx >= getListSize()) [[unlikely]]
			return nullptr;
		return *reinterpret_cast<C_Entity**>(firstEntity + (idx * sizeof(uintptr_t)));
	}

	inline constexpr C_Entity* operator[](size_t idx) const {
		return get(idx);
	}
};  // Size=0x0050

class C_MobEntityList {
public:
private:
	[[maybe_unused]] uint8_t pad_0x0000[0x38]{};  // 0x0000
public:
	uintptr_t firstEntity{};  // 0x0038
	uintptr_t lastEntity{};   // 0x0040
	uintptr_t endAddr{};      // 0x0048

	inline constexpr size_t getListSize() const {
		return (lastEntity - firstEntity) / sizeof(uintptr_t);
	}

	inline constexpr C_Entity* get(size_t idx) const {
		if (idx >= getListSize()) [[unlikely]]
			return nullptr;
		return *reinterpret_cast<C_Entity**>(firstEntity + (idx * sizeof(uintptr_t)));
	}

	inline constexpr C_Entity* operator[](size_t idx) const {
		return get(idx);
	}
};  // Size=0x0050